package com.xm.servlet;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * @author xie'lin'feng
 * @date 2020-08-26-19:06
 * @description 足迹处理器
 */
@WebServlet("/foot")
public class FootmarkServlet extends HttpServlet {
    @Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        String type = req.getParameter("type");
        switch (type){
            case "add":
                add(req, resp);
                break;
            case "del":
                del(req, resp);
                break;
            case "getAll":
                getAll(req, resp);
                break;
        }
    }

    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        doPost(req, resp);
    }

    /**
     * 新增足迹
     * @param req
     * @param resp
     * @throws ServletException
     * @throws IOException
     */
    protected void add (HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException{

    }

    /**
     * 删除足迹
     * @param req
     * @param resp
     * @throws ServletException
     * @throws IOException
     */
    protected void del (HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException{

    }

    /**
     * 用户足迹列表
     * @param req
     * @param resp
     * @throws ServletException
     * @throws IOException
     */
    protected void getAll (HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException{

    }
}
